﻿@model Quester.Models.TestVModel
@using Quester.Models;
@{
    ViewBag.Title = "TestEdit";
}

<h2>@Model.Subject - @Model.TestName</h2>
<table class="editForm">
    <tbody>
        <tr>
            <th>@Html.LabelFor(m => m.CreatorName)</th>
            <td>@Html.TextBoxFor(m => m.CreatorName, new { disabled = "disabled" })</td>
            <th>@Html.LabelFor(m => m.CreationDate)</th>
            <td>@Html.TextBoxFor(m => m.CreationDate, new { disabled = "disabled" })</td>
        </tr>
        <tr>
            <th>@Html.LabelFor(m => m.EditorName)</th>
            <td>@Html.TextBoxFor(m => m.EditorName, new { disabled = "disabled" })</td>
            <th>@Html.LabelFor(m => m.LastModDate)</th>
            <td>@Html.TextBoxFor(m => m.LastModDate, new { disabled = "disabled" })</td>
        </tr>
    </tbody>
</table>

<br />

<div>
    <a class = "ActButton" href="@Url.Action("AddQuestion")/@Model.TestID" >
        <img src="@Url.Content("~/Content/Imgs/IconAdd.png")" style="display:inline;"/>Нове запитання
    </a>
</div>

<br />

<table class="XListContent" width="100%">
    <tbody>
    @if (Model.Questions.Count != 0)
    {
        foreach (QuestionVModel q in Model.Questions)
        {
            <tr>
                <td style="width: 100%;">@q.QuestionStr
                </td>
                <td>
                    <a class = "ActButton" href="@Url.Action("QuestionEdit")/@q.QuestionID" >
                        <img src="@Url.Content("~/Content/Imgs/IconEdit.png")" style="display:inline;"/>Edit
                    </a>
                </td>
                <td>
                    <a class = "ActButton" href="@Url.Action("QuestionDelete")/@q.QuestionID" >
                        <img src="@Url.Content("~/Content/Imgs/IconDelete.png")" style="display:inline;"/>Delete
                    </a>
                </td>
            </tr>
        }
    }
    else
    {
        <tr>
            <td>Запитань ще не створено.
            </td>
        </tr> 
    }
    </tbody>
</table>


